
def background():
    CNTX.save()
    CNTX.set_source_rgb(*COLOR("white"))
    CNTX.rectangle(0,0,400,200)
    CNTX.fill()
    CNTX.restore()
    pass

def stripes():

    def stripe():
        CNTX.save()
        CNTX.set_source_rgb(*COLOR("red"))
        CNTX.rectangle(0,0,400,200.0/13)
        CNTX.fill()
        CNTX.restore()    
        pass    
    
    CNTX.save()
    for i in range(7):
        stripe()
        CNTX.translate(0,2*200.0/13)
    CNTX.restore()    

def stars():
    def background():
        CNTX.save()
        CNTX.set_source_rgb(*COLOR("navyblue"))
        CNTX.rectangle(0,0,200,7.0*200/13)
        CNTX.fill()
        CNTX.restore()        
        
    def star():
        CNTX.save()
        CNTX.set_source_rgb(*COLOR("white"))
        CNTX.move_to(0,100)
        CNTX.rel_line_to(50,-25)
        CNTX.rel_line_to(25,-50)
        CNTX.rel_line_to(25,50)
        CNTX.rel_line_to(50,25)
        CNTX.rel_line_to(-50,25)
        CNTX.rel_line_to(-25,50)
        CNTX.rel_line_to(-25,-50)
        CNTX.close_path()
        CNTX.fill()
        CNTX.restore()

    def star_row( count ):
        CNTX.save()
        for i in range(count):
            star()
            CNTX.translate(650,0)
        CNTX.restore()
        pass
        
    CNTX.save()
    background()
    CNTX.scale(0.055,0.055)
    for i in range(4):
        star_row(6)
        CNTX.translate(350,200)
        star_row(5)
        CNTX.translate(-350,200)
    
    star_row(6)
        
    CNTX.restore()
    pass

background()
stripes()
stars()
